Fix x86_64 SMP support.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 7 Feb 2006 13:57:40 +0000 (13:57 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 7 Feb 2006 13:57:40 +0000 (13:57 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c
linux-2.6-xen-sparse/drivers/xen/core/smpboot.c

index eaa32d820677898f1fd122b86f4a0acfc9c98732..37f63dab705a216ac967418dcb6ef9d31a91693a 100644 (file)
@@ -911,6 +911,9 @@ void __init setup_arch(char **cmdline_p)
        init_apic_mappings();
 #endif
 #endif
+#if defined(CONFIG_XEN) && defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
+       prefill_possible_map();
+#endif
 
 #if defined(CONFIG_XEN_PRIVILEGED_GUEST) || !defined(CONFIG_XEN)
        /*
index a76d6465903f9287fecb6533b138d741305b9968..a1bcc022b4fa526e5de0957fce37e3b687595b44 100644 (file)
@@ -272,8 +272,10 @@ void __cpuinit cpu_init (void)
         * Initialize the per-CPU GDT with the boot GDT,
         * and set up the GDT descriptor:
         */
+#ifndef CONFIG_XEN 
        if (cpu)
                memcpy(cpu_gdt(cpu), cpu_gdt_table, GDT_SIZE);
+#endif
 
        cpu_gdt_descr[cpu].size = GDT_SIZE;
 #ifndef CONFIG_XEN 
index 5a38f6b1f6671a782e133e3d98acdd29ecb32c29..91f507299bceb72434aa6bce2285c64965447623 100644 (file)
@@ -81,6 +81,18 @@ EXPORT_SYMBOL(x86_cpu_to_apicid);
 unsigned int maxcpus = NR_CPUS;
 #endif
 
+void __init prefill_possible_map(void)
+{
+       int i, rc;
+
+       for (i = 0; i < NR_CPUS; i++) {
+               rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
+               if (rc == -ENOENT)
+                       break;
+               cpu_set(i, cpu_possible_map);
+       }
+}
+
 void __init smp_alloc_memory(void)
 {
 }